package org.example.order.feign;

import org.example.order.feign.fallback.ProductFeignClientFallback;
import org.example.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author : wer
 * @Date: 2025/6/22 10:53
 * @Description: 产品服务的Feign客服端
 */


// 如果连接第三方api（不需要找注册中心），除了value外还需指定url
@FeignClient(value = "service-product", fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {

    @GetMapping("/product/{id}")
    Product getProductById(@PathVariable("id") Long id);
}
